<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>青菜萝卜博客管理系统</title>
		<link rel="shortcut icon" type="image/png" href="static/i/favicon.png">
		<link rel="stylesheet" href="static/css/admin.css">
		<link rel="stylesheet" href="static/layui/css/layui.css">
		<link rel="stylesheet" href="static/editor.md/css/editormd.min.css" />
		<script src="static/layui/layui.js"></script>
	</head>
	<body>
		<div class="header">
			<h2 class="z cl"><a href="index.html"><img src="static/img/logo2.png"></a></h2>
			<div class="y cl">
				<a target="_blank" href="http://www.huding.name">网站首页</a>
				<a id="top-logout" href="javascript:">退出</a>
			</div>
		</div>
		<div class="admin">
			<div class="aleft" id="left-container"></div>
			<div class="aright">

				<fieldset class="layui-elem-field layui-field-title" style="margin: 20px 30px 20px 20px;">
					<legend>添加文章</legend>
				</fieldset>

				<form class="layui-form bform" method="post">

					<div class="layui-form-item">
						<label class="layui-form-label">文章标题</label>
						<div class="layui-input-block">
							<input type="text" name="blog.title" required lay-verify="required" placeholder="必填内容" autocomplete="off" class="layui-input">
						</div>
					</div>

					<div class="layui-form-item" style="width: 300px;">
						<label class="layui-form-label">所属分类</label>
						<div class="layui-input-block" id="category">
						
						</div>
					</div>

					<div class="layui-form-item">
						<label class="layui-form-label">文章作者</label>
						<div class="layui-input-block">
							<input type="text" name="blog.author" required lay-verify="required"  placeholder="请输入内容" autocomplete="off" class="layui-input">
						</div>
					</div>

					<!--<div class="layui-form-item">
						<label class="layui-form-label">文章来源</label>
						<div class="layui-input-block">
							<input type="text" name="source" placeholder="请输入内容" autocomplete="off" class="layui-input">
						</div>
					</div>-->

					<!--<div class="layui-form-item">
						<label class="layui-form-label">审核显示</label>
						<div class="layui-input-block">
							<input type="checkbox" title="显示" name="open" value="1" checked>

						</div>
					</div>-->

					<!--<div class="layui-form-item">
						<label class="layui-form-label">推荐精选</label>
						<div class="layui-input-block">
							<input type="checkbox" title="推荐" name="commend" value="1" checked>
							<input type="checkbox" title="精选" name="choice" value="1">
						</div>
					</div>-->

					<div class="layui-form-item">
						<label class="layui-form-label">缩略图</label>
						<div class="layui-input-block">
							<input type="hidden" name="blog.coverURL" id="blog-cover"/>
							<input type="file" name="image" id="blog-cover-file" class="layui-upload-file"/>
						</div>
					</div>
					
					<div class="layui-form-item" id="cover-preview-cnt">
						<label class="layui-form-label"></label>
						<div>
							<img id="cover-preview-img" class="blog-report-cover"/>
						</div>
					</div>

					<div class="layui-form-item layui-form-text">
						<label class="layui-form-label">文章摘要</label>
						<div class="layui-input-block">
							<textarea name="blog.summary" required lay-verify="required"  placeholder="请输入内容" class="layui-textarea"></textarea>
						</div>
					</div>

					<div class="layui-form-item layui-form-text">
						<label class="layui-form-label">文章内容</label>
						<div class="layui-input-block">
							<div id="publish-editormd"></div>
						</div>
					</div>
					 <div class="layui-form-item">
					    <label class="layui-form-label">保存方式</label>
					    <div class="layui-input-block">
					      <select name="blog.status" lay-filter="aihao">
					        <option value=""></option>
					        <option value="0" selected="">发表</option>
					        <option value="1">草稿</option>
					      </select>
					    </div>
					  </div>
					  <div class="layui-form-item">
					    <label class="layui-form-label">文章标签</label>
					    <div class="layui-input-block">
					      <input type="text" name="blog.tags" required lay-verify="required"  placeholder="请输入内容" autocomplete="off" class="layui-input">
					    </div>
					  </div>
					 <hr>
					<div class="layui-form-item">
						<div class="layui-input-block">
							<button class="layui-btn" lay-submit lay-filter="blogReport">立即提交</button>
							<button class="layui-btn layui-btn-primary" onclick="history.go(-1)">返回</button>
						</div>
					</div>

				</form>
				<script src="static/js/jquery.min.js"></script>
				<script src="static/editor.md/editormd.min.js"></script> 
				<script>
					layui.config({base:'static/js/'}).use('blog-add');
				</script>
				<script id ="template" type="text/template">
					<select name="blog.categoryID">
						{{#  layui.each(d.data, function(index, item){ }}
							<option value="{{item.id}}">{{item.name}}</option>
						{{# });}}
					</select>
				</script>
			</div>
		</div>
	</body>

</html>